<?php 
// +----------------------------------------------------------------------
// | Item        初始化数据控制器
// +----------------------------------------------------------------------
// | Copyright
// +----------------------------------------------------------------------
// | Versions
// +----------------------------------------------------------------------
// | Author       YanHao
// +----------------------------------------------------------------------
// | Date         2017-07-05
// +----------------------------------------------------------------------

namespace app\admin\controller;

class Initdata extends Base
{
    protected  $header = '数据初始化';
    protected  $desc   = '选项';

    /**
     * 首页
     * @Author  YanHao
     * @Date    2017-07-06
     * @version [version]
     * @return  [type]     [description]
     */
    public function initindex()
    {   
        return $this->fetch();
    }
    /**
     * 初始化数据
     * @Author  YanHao
     * @Date    2017-07-05
     * @version [version]
     * @return  [type]     [description]
     */
    public function initAdmin() 
    {
        $res[0] = \app\admin\modeldata\Admin::perform();//初始化管理员表
        return !array_sum($res) ? '初始化成功' : '初始化失败';
    }
    /**
     * 初始化权限列表
     * @Author  YanHao
     * @Date    2017-07-10
     * @version [version]
     * @return  [type]     [description]
     */
    public function initAuth()
    {   
        $handle = \app\admin\modeldata\AuthRule::run(); 
        return  $handle ? 'init successfully' : 'init defeat';
    }
    /**
     * 初始化数据
     * @Author  YanHao
     * @Date    2017-07-10
     * @version [version]
     * @return  [type]     [description]
     */
    public function initData()
    {

    }
    
}